package com.lsh.oms.core.service.shipping.core;

import com.alibaba.fastjson.JSONArray;
import com.lsh.oms.api.model.order.receipt.ReceiptHeadDto;
import com.lsh.oms.api.model.query.QueryShippingDto;
import com.lsh.oms.api.model.shipping.ModifyShippingExtDto;
import com.lsh.oms.api.model.shipping.ModifyTransDto;
import com.lsh.oms.api.model.shipping.OrderShippingHeadTmsDto;
import com.lsh.oms.api.model.shipping.SetDelayShippingDto;
import com.lsh.oms.core.model.order.OrderShippingHead;
import com.lsh.oms.core.model.order.OrderShippingHeadWithBLOBs;
import com.lsh.oms.core.service.tool.Criteria;
import com.lsh.oms.core.service.tool.Pageable;
import com.lsh.oms.core.service.tool.TmsPageable;

import java.util.List;
import java.util.Map;
import java.util.Optional;

/**
 * @author peter
 */
public interface ShippingService {

    Map<String, Object> findShippingDetailsByOrderId(Long orderId);

    Pageable<OrderShippingHeadWithBLOBs> query(Criteria criteria, long page, long pageLimit);

    Optional<OrderShippingHeadWithBLOBs> findByOrderId(Long orderId, boolean detailsRequired);

    Optional<OrderShippingHeadWithBLOBs> findById(Long id, boolean detailsRequired);

    Optional<OrderShippingHeadWithBLOBs> findNewByAddressId(Long addressId, boolean detailsRequired);

    TmsPageable<OrderShippingHeadWithBLOBs> findByParam(QueryShippingDto queryShippingDto, boolean detailsRequired);

    Map<String, Long> findNumByParam(QueryShippingDto queryShippingDto);

    Boolean updateTrans(ModifyTransDto modifyTransDto);

    Boolean updateOmsExt(ModifyShippingExtDto modifyShippingExtDto);

    Boolean setDelay(SetDelayShippingDto setDelayShippingDto);

    List<OrderShippingHeadTmsDto> findByOrderIds(JSONArray orderIds);

    void update(Long id, OrderShippingHead forUpdate);

    Map<String, Object> receipt(Long id, ReceiptHeadDto request);
}
